<template>
  <div>
    <h3 class="attach-title">项目信息</h3>
    <hr />
    <table class="table table-sm table-borderless table-attach-detail">
      <colgroup>
        <col width="20%" />
        <col width="30%" />
        <col width="20%" />
        <col width="30%" />
      </colgroup>
      <tbody>
        <tr>
          <td>{{ customerNameLabel }}：</td>
          <td>{{ projectData.customer_name }}</td>
          <td>被担保人类型：</td>
          <td>{{ projectData.org_class_name }}</td>
        </tr>
        <tr>
          <td>地址：</td>
          <td>{{ projectData.address }}</td>
          <td>{{ customerNo.label }}：</td>
          <td>{{ customerNo.value || '-' }}</td>
        </tr>
        <tr>
          <td>本次支用金额：</td>
          <td>{{ projectData.cur_use_funds }} 万元</td>
          <td>支用期限：</td>
          <td>{{ projectData.months || '-' }}个月</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
import { enumDispute } from '@/bank/plugins/enum'
import { projectIsCompany } from '@/bank/views/fast/index'

export default {
  components: {},
  props: {
    projectData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      enumDispute,
    }
  },
  computed: {
    isCompany() {
      return projectIsCompany(this.projectData)
    },
    customerNameLabel() {
      return this.isCompany ? '企业名称' : '贷款人姓名'
    },
    customerNo() {
      const { projectData, isCompany } = this
      return isCompany
        ? {
            label: '营业执照编号',
            value: projectData.register_no,
          }
        : {
            label: '身份证号',
            value: projectData.lender_idcard,
          }
    },
    // projectFunds() {
    //   const { projectData } = this
    //   return (
    //     +projectData.reply_funds || +projectData.approved_funds || +projectData.apply_funds || ''
    //   )
    // },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>

<style lang="scss" scoped>
.attach-title {
  font-size: 1.1rem;
  font-weight: bold;
}
.table-attach-detail tr > td:nth-child(2n + 1) {
  text-align: right;
}
</style>
